fix: return protocol errors for invalid tool args#2163
Conversation
🦋 Changeset detectedLatest commit: 5ef13fd The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@modelcontextprotocol/client
@modelcontextprotocol/codemod
@modelcontextprotocol/server
@modelcontextprotocol/server-legacy
@modelcontextprotocol/express
@modelcontextprotocol/fastify
@modelcontextprotocol/hono
@modelcontextprotocol/node
commit: |
d683549 to
7641e96
Compare
|
CI note: I checked the remaining red Node 20 job. The invalid-argument coverage added in this PR passes in that run; the failure is in test/server/cloudflareWorkers.test.ts with a Miniflare network connection lost error, which is outside the touched server validation path. I also tried to rerun the failed job, but GitHub requires repo admin rights for that. |
7641e96 to
e814d61
Compare
|
Rebased on current Validated locally:
The pre-push hook also completed the repo-wide build, typecheck, and lint steps successfully. |
e814d61 to
5ef13fd
Compare
|
Rebased and force-pushed the branch. I also updated the e2e contract expectations so invalid tool arguments now assert JSON-RPC -32602 instead of an isError tool result. Targeted validation passed:
One combined e2e invocation hit a Vitest worker process exit after the relevant files had already run; rerunning the scenarios individually passed, so I split the validation above. The push hook also completed the repo-level build/typecheck/lint successfully. |
Summary
To verify
Fixes #2162